<?php
  require_once("../includes.php");
  $membership = New Membership();
  $membership->confirm_admin();

  $select_dag   = $_POST['dag'];
  $select_tijd  = $_POST['tijd'];
  $select_users = User::get_distinct($select_dag, $select_tijd);

  $aantal = Les::get_max_deelnemers(); 

  include('../header.php');
?>

<div id='agenda'>
<div class="block">
  <h2 class="red">Lesgroep Verlengen</h2>
  <div id="info">
    <?php echo Website::create_link("admin/","Administratie", "right"); ?>
    
    <form action="action.php" method="post">
      <h3>Selecteer de dag en tijd van de aan te passen les</h3>

      <?php
        echo Website::selection('Dag van de week', 'dag', Agenda::days(), $select_dag);
        echo Website::selection('Tijd', 'tijd', Agenda::time_table(), $select_tijd);
      ?>
      
      
    <ul>
      <li>
        <label for='tijd'>Aantal Weken</label>
        <input type="text" name='weken'>
      </li>
    </ul>

      <h3 class='middle'>Personen in deze lesgroep:</h3>

      <?php for ($i = 1; $i <= $aantal; $i++)
              echo User::selection_all('Persoon '.$i, 'keuze'.$i, $select_users[$i-1]); ?>

      <input type='hidden' name='action' value='edit'>
      <input type='submit' id='submitButton' value='Verlengen'>
    </form>
  </div>
</div>
</div>
<?php include('../footer.php'); ?>